/**
 * 
 */
package info.niwota.home.fm;

import java.util.List;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;

/**
 * @author qiangli
 * 
 */
public final class Intents {

	private Intents() {
	}

	public static final String EXTRA_INPUT = "instant.voiceinput.extra.input";

	public static final String EXTRA_HINT = "instant.voiceinput.extra.hint";

	public static final String EXTRA_TITLE = "instant.voiceinput.extra.title";

	public static boolean isIntentAvailable(Context ctx, String action) {
		final PackageManager packageManager = ctx.getPackageManager();
		final Intent intent = new Intent(action);
		List<ResolveInfo> list = packageManager.queryIntentActivities(intent,
				PackageManager.MATCH_DEFAULT_ONLY);
		return list.size() > 0;
	}
}
